<template>
  <div class="aside">
    <el-card class="box-card">
      <div class="write">
        <div class="writel">
          <el-icon><Avatar /></el-icon>
          <div>创作中心</div>
        </div>
        <div class="writer">草稿箱（{{ draft }}）</div>
      </div>
      <div class="problem">
        <ul>
          <li
            v-for="(item, index) in problems"
            :key="item"
            class="li"
            @click="liclick(index)"
          >
            <el-icon v-if="index == 0"><ChatLineSquare /></el-icon>
            <el-icon v-else-if="index == 1"><VideoCamera /></el-icon>
            <el-icon v-else-if="index == 2"><Money /></el-icon>
            <el-icon v-else><MessageBox /></el-icon>
            <div>{{ item }}</div>
          </li>
        </ul>
      </div>
      <div class="open">
        <h4>开启你的yida创作之旅</h4>
        <div>发布首篇内容</div>
      </div>
      <el-button class="zzybutton"
        ><el-icon><Plus /></el-icon>开始创作</el-button
      >
    </el-card>
  </div>
</template>

<script >
import { defineComponent, ref } from "vue";
import { useRouter } from "vue-router";

export default defineComponent({
  components: {},
  setup() {
    const router = useRouter();
    const problems = ["回答问题", "发视频", "写文章", "提问题"];
    const draft = ref(0);
    const liclick = (e) => {
      console.log("0", e);
      switch (e) {
        case 0:
          router.push("/answer/0");
          break;
        case 1:
          router.push("/study");
          break;
        case 2:
          router.push("/wangeditor");
          break;
        case 3:
          router.push({ name: "wangeditor", query: { issue: true } });
          break;
      }
    };
    return { problems, draft, liclick };
  },
});
</script>

<style scoped lang="less">
.aside {
  .write {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;

    .writel {
      display: flex;
    }
  }
  .problem {
    text-align: center;
    margin-top: 20px;
    .el-icon {
      font-size: 30px;
      margin-bottom: 10px;
    }
    > ul {
      display: flex;
      padding: 0;
      > li {
        display: block;
        width: 80;
        margin-left: 10px;
        list-style: none;
      }
    }
  }
  .open {
    padding: 1px 10px 10px 10px;
    background-color: #f9f9fa;
  }
  .zzybutton {
    margin-top: 10px;
    height: 40px;
    width: 100%;
    color: #409eff;
    > span > i {
      vertical-align: middle;
    }
  }
}
</style>
